package com.lwlk.zdk.service.EnterpriseService.impl;

import com.lwlk.zdk.mapper.pw.pwDriverMapper;
import com.lwlk.zdk.mapper.sys.sysEnterpriseMapper;
import com.lwlk.zdk.model.pw.pwDriver;
import com.lwlk.zdk.model.sys.sysEnterprise;
import com.lwlk.zdk.service.EnterpriseService.EnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class EnterpriseServiceImpl implements EnterpriseService {

    @Autowired
    sysEnterpriseMapper sysEnterpriseMapper;
    @Autowired
    pwDriverMapper pwDriverMapper;

    @Override
    public int add(sysEnterprise sysEnterprise) {
        int i=sysEnterpriseMapper.insertSelective(sysEnterprise);
        return i;
    }

    @Override
    public  int update(sysEnterprise sysEnterprise) {
        int i=sysEnterpriseMapper.updateByExampleSelective(sysEnterprise);
        return i;
    }

    @Override
    public Map<String, Object> selectEnterprise() {
        Map<String,Object> enterprise=sysEnterpriseMapper.selectEnterprise();
        return enterprise;
    }

    @Override
    public int deleteBatch(Integer[] id) {
        int i=sysEnterpriseMapper.deleteBatch(id);
        return i;
    }

    @Override
    public int delete(Integer id) {
        int i=sysEnterpriseMapper.delete(id);
        return i;
    }

    @Override
    public List<Map<String,Object>> selectAll(String areaCode,String enterprise) {
        List<Map<String,Object>> sysEnterpriseList=sysEnterpriseMapper.selectAll(areaCode,enterprise);
        return sysEnterpriseList;
    }


    @Override
    public String selectBusiness(Integer enterpriseId) {
        String Business=sysEnterpriseMapper.selectBusiness(enterpriseId);
        return Business;
    }

    @Override
    public List<Map<String, Object>> selectPlatform(Integer enterpriseId) {
        List<Map<String,Object>>sysEnterpriseList=sysEnterpriseMapper.selectPlatform(enterpriseId);
        return sysEnterpriseList;
    }

    @Override
    public List<pwDriver> selectDriver() {
        List<pwDriver> pwDriverList=pwDriverMapper.selectDriver();
        return pwDriverList;
    }

    @Override
    public List<Map<String, Object>> searchEnterprise(String areaCode) {
        List<Map<String,Object>>enterpriseList=sysEnterpriseMapper.searchEnterprise(areaCode);
        return enterpriseList;
    }

    @Override
    public String selectBusinessCertificate(int parseInt) {
        String businessCertificate=sysEnterpriseMapper.selectBusinessCertificate(parseInt);
        return businessCertificate;
    }

    @Override
    public List<Map<String, Object>> selectByAreaCode(String areaCode,Integer platformId) {
        List<Map<String,Object>>enterpriseList=sysEnterpriseMapper.selectByAreaCode(areaCode,platformId);
        return enterpriseList;
    }

    @Override
    public int selectManyVehicleNumber(String enterprise) {
        int i=sysEnterpriseMapper.selectManyVehicleNumber(enterprise);
        return i;
    }

    @Override
    public List<Map<String, Object>> selectDetails(Integer enterpriseId) {
        List<Map<String,Object>>enterpriseDetails=sysEnterpriseMapper.selectDetails(enterpriseId);
        return enterpriseDetails;
    }


}
